#include <iostream>
#include <vector>
#include <limits.h>

using namespace std;

int main()
{
    int t = 0, n = 0;
    cin >> t;
    while (t--)
    {
        cin >> n;
        vector<int> arr(n);
        int Min = INT_MAX;
        for (int i = 0; i < n; ++i)
        {
            cin >> arr[i];
            if (arr[i] % 2 != 0)
                Min = min(Min, arr[i]);
        }
        if (arr[0] % 2 != 0)
            cout << 0 << endl;
        else if (arr[0] > Min)
            cout << 1 << endl;
        else if (arr[0] < Min)
            cout << -1 << endl;
    }
    return 0;
}